import {sequelize} from "../db/index.js";
import {getModels,defineModel} from '../utils/tools.js'
 

let modelFiles = getModels();
console.log('查找到的模型文件',modelFiles);

let db = defineModel(sequelize,modelFiles);

export let dbRs = db

export const sync = async() => {
    console.log(db);

    await sequelize.sync({force: true})

    let arr = [
        {
            title:'1122',
            author: '忘记'
        }
    ]

    db.Blog.bulkCreate(arr)
    
}
